package com.learn.mapstruct.valueMapping;

import org.mapstruct.Mapper;
import org.mapstruct.MappingConstants;
import org.mapstruct.ValueMapping;

@Mapper
public interface ValueMappingMapper {

	@ValueMapping(target = MappingConstants.THROW_EXCEPTION, source = "RED")
	@ValueMapping(target = "GREEN1", source = "GREEN")
	@ValueMapping(target = "DEFAULT", source = MappingConstants.ANY_REMAINING)
	Enum2 to(Enum1 value);
}

enum Enum1 {
	RED,
	GREEN;
}

enum Enum2 {
	GREEN1,
	DEFAULT,
	;
}
